<template>
  <div class="logo">
    <img v-if="showTitle" src="@/assets/stations.svg" alt="logo" style="height: 25px;width: 25px;margin: -7px 3px 0px 0px;display: inline-block;line-height:64px;">
    <h3 v-if="showTitle" style="color:#fff;display: inline-block;">{{ this.titles }}</h3>
    <img v-if="!showTitle" src="@/assets/stations.svg" alt="logo" style="height: 25px;width: 25px;margin: -7px 3px 0px 10px;display: inline-block;line-height:64px;">
  </div>
</template>

<script>
import { mixin, mixinDevice } from '@/utils/mixin'

export default {
  name: 'Logo',
  components: {
  },
  mixins: [mixin, mixinDevice],
  data () {
    return {
      titles: ''
    }
  },
  props: {
    title: {
      type: String,
      default: '信息技术所快速开发平台',
      required: false
    },
    showTitle: {
      type: Boolean,
      default: true,
      required: false
    }
  },
  created () {
    if (this.layoutMode === 'topmenu') {
      if (this.title.length > 11) {
        this.titles = this.title.substring(0, 10) + '...'
      } else {
        this.titles = this.title
      }
    } else {
      if (this.title.length > 11) {
        this.titles = this.title.substring(0, 10) + '...'
      } else {
        this.titles = this.title
      }
    }
  }
}
</script>
